<script type="text/javascript">
function ValidateForm(theForm)
	{
		Error = "";	
		Valid = true;
		validateInput(theForm.title,'Title');
		//validateInput(theForm.desc,'Description');
		//validateInput(theForm.name,'Name of Photographer');
		validateSelect(theForm.pic,'Picture');
		
		if(theForm.chk.checked==false)
		{
			Error += "Error: Please accept you are the owner or has permission from owner to upload it";
			Valid = false;
		}
		
		if(Valid == false)
		{
			alert(Error);	
			return false;
		}
	}

</script>
<form name="picadd" method="post" enctype="multipart/form-data" action="index.php?tc=picture_addcode" onSubmit="return ValidateForm(this);">
<?php
if($_REQUEST['_e'] == 2)
{ ?>
	<table align="center" border="0">
	<tr>
    	<td align="center"><div class="sucmsg"><img src="images/information.png" align="absmiddle" />&nbsp;Picture submitted successfully.</div></td>
    </tr>    
    </table>
<?php } ?>
<?php
if($_REQUEST['_e'] == 1)
{ ?>
	<table align="center" border="0">
	<tr>
    	<td align="center"><div class="sucmsg"><img src="images/information.png" align="absmiddle" />&nbsp;Invalid file format.</div></td>
    </tr>    
    </table>
<?php } ?>
<table width="99%" align="center" border="0"  class="list">
<thead>
<tr>
	<td colspan="2" align="left">
        <div style="float:left">Add Picture Details</div>
        <div style="float:right"><a href="index.php?tc=picture">Back</a></div>
    </td>
</tr>
</thead>
<tr>
	<td align="right" width="150">Title</td>
    <td align="left"><input class="text" name="title" type="text"/></td>
</tr>
<tr>
	<td align="right" width="150">Description</td>
    <td align="left"><textarea name="desc" rows="4" cols="50"></textarea></td>
</tr>
<tr>
	<td align="right" width="150">Date Taken</td>
    <td align="left"><input class="text" name="tdate" type="text" /></td>
</tr>
<tr>
	<td align="right" width="150">Name of Photographer/Owner</td>
    <td align="left"><input class="text" name="name" type="text" /></td>
</tr>
<tr>
	<td align="right" width="150">Select Picture</td>
    <td align="left"><input name="pic" type="file" /></td>
</tr>
<tr>
	<td align="left" colspan="2"><input type="checkbox" name="chk" >Photo is original and that user is the photographer or has permission from owner to upload it</td>
    
</tr>
<tr>
	<td align="right" width="150"></td>
    <td align="left"><input type="submit" value="Submit" name="save_picture">&nbsp;<input type="reset" name="reset" value="Clear" /></td>
</tr>
</table>
</form>